Option default none
Option explicit
CPU 48
Const stepsize=2
Const displaystring="EGT 3"
Dim integer lastx1, lastx2, lastx3, lasty1, lasty2, lasty3 ' Global variables to store last pointer position
Const whitestart=-150, greenstart=-100, yellowstart=0, redstart=50, blackstart = 150 ' position of display bands in degrees - must be in ascending order
Dim integer a, i, radius, firsttime=1, needlelength
'If MM.HRes<=MM.VRes Then ' set the radius of the display less the "bezel"
'  radius=MM.HRes/2-4
'Else
'  radius=MM.VRes/2-4
'EndIf
radius=106 ' center 110-4
needlelength= radius\5*4-1
setpin 11,dout
pin(11)=1
CLS
Circle 110,110,radius+3,0,,0,0
Circle 110,110,radius+3,1,1,RGB(210,210,210)',RGB(210,210,210) 'create the bezel
segment(110,110,radius,whitestart,greenstart, RGB(white))
segment(110,110,radius,greenstart,yellowstart, RGB(green))
segment(110,110,radius,yellowstart,redstart, RGB(yellow))
segment(110,110,radius,redstart,blackstart, RGB(red))
segment(110,110,radius,blackstart,whitestart+360, 0)
Circle 110,110,needlelength+1,0,,0,0
Text 110,200,displaystring,cm,4,1,RGB(blue) ' string centred in black segment
Do ' run the pointer backwards and forwards
'    For i=greenstart To blackstart-1
    For i=0 To 600
      needle(110,110,needlelength,i\2-150,RGB(white))
      Text 110,110,"   ",cm,1,1,RGB(yellow) ' string centred in black segment
      If i<100 Then Text 110,110,Str$(i),cm,1,1,RGB(white)
      If i>100 And i<300 Then Text 110,110,Str$(i),cm,1,1,RGB(green)
      If i>300 And i<400 Then Text 110,110,Str$(i),cm,1,1,RGB(yellow)
      If i>400 And i<600 Then Text 110,110,Str$(i),cm,1,1,RGB(red)
      Pause 100
    Next i
    For i=600 To 0 Step -1
      needle(110,110,needlelength,i\2-150,RGB(white))
      Text 110,110,"   ",cm,1,1,RGB(yellow) ' string centred in black segment
      If i<100 Then Text 110,110,Str$(i),cm,1,1,RGB(white)
      If i>100 And i<300 Then Text 110,110,Str$(i),cm,1,1,RGB(green)
      If i>300 And i<400 Then Text 110,110,Str$(i),cm,1,1,RGB(yellow)
      If i>400 And i<600 Then Text 110,110,Str$(i),cm,1,1,RGB(red)
      Pause 100
    Next i
Loop
End
                                                                